{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "# 最小二乘法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pylab as pl\n",
    "import math"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.4349474726647082\n",
      "2.0559131261889667\n"
     ]
    },
    {
     "data": {
      "text/plain": "[<matplotlib.lines.Line2D at 0x25d718b9c30>]"
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD8CAYAAABuHP8oAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAArtUlEQVR4nO3deVzVVf7H8ddhBwWUTQTEXXNXwN1MU3MpbbHFyjZttJmmqabRLC2zckqtqX41NVlqjZnWtKrlbmqZKYL7vguCgCL7dpfz++OLhQrKcuFyL5/n48ED7pfv/d7PEXz79dyzKK01QgghHI+LvQsQQghRORLgQgjhoCTAhRDCQUmACyGEg5IAF0IIByUBLoQQDuqaAa6Umq+USlVK7S1xbI5S6qBSardS6lulVINqrVIIIcQVynMH/gkw7LJja4COWuvOwGHgORvXJYQQ4hquGeBa601A+mXHVmutzcUPfwMiqqE2IYQQV+Fmg2uMA74oz4lBQUG6WbNmNnhJIYSoO+Li4s5prYMvP16lAFdKTQXMwKKrnDMBmAAQGRnJ9u3bq/KSQghR5yilTpV2vNKjUJRSDwG3APfrqyyoorWeq7WO0VrHBAdf8Q+IE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Sil1EqNb7Eal1Gc4d5sTgUSt9dbix19hBLozt3kwcEJrnaa1NgHfAH1w7jZfVFYbbZZpjhDgsUBrpVRzpZQHRuf/UjvXZFNKKYXRL3pAa/2vEt9aCjxU/PVDwPc1XVt10Vo/p7WO0Fo3w/iZrtdaj8W523wWSFBKtS0+NAjYjxO3GaPrpJdSyqf493wQxns8ztzmi8pq41JgjFLKUynVHGgNbKvUK2ita/0HMAI4DBwDptq7nmpoXz+M/0LtBnYWf4wAAjHevT5S/DnA3rVWU/sHAMuLv3bqNgNdge3FP+vvgIZ1oM0zgIPAXmAh4OlsbQYWY/TxmzDusMdfrY3A1OI8OwQMr+zrykxMIYRwUI7QhSKEEKIUEuBCCOGgJMCFEMJBSYALIYSDkgAXQggHJQEuhBAOSgJcCCEclAS4EEI4qP8H30xw4gZRpQ0AAAAASUVORK5CYII=\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pylab as pl\n",
    "import math\n",
    "\n",
    "\n",
    "def phi_k(x, k):  # x^k\n",
    "    y = x ** k\n",
    "    return y\n",
    "\n",
    "\n",
    "def squar_least(x, y, w, n):  #w是权重，n是阶数\n",
    "    G = np.zeros((n + 1, n + 1))  #创建矩阵存放 n sum: xi xi^2\n",
    "    d = np.zeros((n + 1))  #创建行数sum:yi xiyi\n",
    "    for i in range(n + 1):\n",
    "        for j in range(n + 1):\n",
    "            G[i, j] = sum((w * phi_k(x, i)) * phi_k(x, j))  #算n  x的和 x^2的和\n",
    "\n",
    "    for i in range(n + 1):\n",
    "        d[i] = sum((w * phi_k(x, i)) * y)  #算y的和  xy的和\n",
    "\n",
    "    a = np.dot(np.linalg.inv(G), d)  #解方程\n",
    "    return a\n",
    "\n",
    "\n",
    "x = np.array([1, 4, 9, 16, 25, 36, 49, 64, 81])\n",
    "y = np.array([1, 2, 3.1, 3.95, 5.01, 6, 6.97, 8, 9.02])\n",
    "w = np.array([1, 1, 1, 1, 1, 1, 1, 1, 1])\n",
    "\n",
    "a = squar_least(x, y, w, 2)  #2指的是2阶\n",
    "yuce_y = a[0] * 1 + a[1] * 0.6 + a[2] * 0.6 * 0.6\n",
    "print(yuce_y)\n",
    "\n",
    "xxx = [];\n",
    "yyy = []\n",
    "for i in range(0, 1000):\n",
    "    xxx.append(i / 10)\n",
    "    yyy.append(a[0] * 1 + a[1] * i / 10 + a[2] * i / 10 * i / 10)\n",
    "pl.scatter(x, y)\n",
    "pl.plot(xxx, yyy)\n",
    "\n",
    "a = squar_least(x, y, w, 1)  #1指的是1阶\n",
    "yuce_y = a[0] * 1 + a[1] * 0.6\n",
    "print(yuce_y)\n",
    "\n",
    "xxx = [];\n",
    "yyy = []\n",
    "for i in range(0, 1000):\n",
    "    xxx.append(i / 10)\n",
    "    yyy.append(a[0] * 1 + a[1] * i / 10)\n",
    "pl.scatter(x, y)\n",
    "pl.plot(xxx, yyy)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 拉格朗日"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x=2.5 f(x)= 1.5296665994020477\n",
      "x=40 f(x)= 6.199927388682746\n"
     ]
    },
    {
     "data": {
      "text/plain": "[<matplotlib.lines.Line2D at 0x25d7190f1c0>]"
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAbsElEQVR4nO3dfWxdd53n8ffX9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/cBB9x9O3AgeL5afA44vOj5at4XXwd+6u7XAjeS2y+rcn+YWQ/wx8Bud7+B3NVq7yHC+6Niw51F92l19yQwf5/WVcPd+939t8HyJLm/vD3k9sO+4G37gLtDKbDEzGwT8BHgm4tWr9Z90QrcDjwE4O5Jdx9jle6PQA3QYGY1QCO5GwhFdn9Ucri/7X1aVxMz2wLsAp4B1rl7P+R+AQDdIZZWSl8DvghkF61brftiGxAHvh20qb5pZk2s0v3h7n3AXwGngH5g3N2fIML7o5LD/W3v07pamFkz8EPgT9x9Iux6wmBmHwUG3f1g2LWUiRrgncDfufsuYJoItRwuV9BLvwvYCmwEmszsU+FWVVyVHO4lv09rOTKzGLlg/667PxqsHjCzDcHrG4DBsOoroduAj5nZCXItuveZ2XdYnfsCcn8/zrj7M8HzR8iF/WrdH+8Hjrt73N1TwKPA7xLh/VHJ4b7q79NqZkaup3rY3f960UuPA3uD5b3AY6WurdTc/X533+TuW8j9WXjS3T/FKtwXAO5+DjhtZjuCVXuAQ6zS/UGuHXOrmTUGf2/2kDtGFdn9UdFnqJrZh8n1Wefv0/rlcCsqLTN7D/DPwEu82Wf+M3J994eBzeT+UH/C3UdCKTIEZnYH8D/c/aNmtpZVui/M7CZyB5drgWPAp8kN6Fbr/vhz4N+Tm2X2HPCfgWYiuj8qOtxFRGRpldyWERGRZSjcRUQiSOEuIhJBCncRkQhSuIuIRJDCXUQkghTuIiIR9P8B7p31iEpk/gQAAAAASUVORK5CYII=\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pylab as pl\n",
    "import math\n",
    "\n",
    "\n",
    "def lagelangri(x, y, ans_x):\n",
    "    ans_y = 0\n",
    "    for i_y in range(len(y)):\n",
    "        temp = 1\n",
    "        for i_x in range(len(x)):\n",
    "            if i_x != i_y:\n",
    "                temp *= (ans_x - x[i_x]) / (x[i_y] - x[i_x])\n",
    "        ans_y += y[i_y] * temp\n",
    "    return ans_y\n",
    "\n",
    "\n",
    "x = np.array([1, 4, 9, 16, 25, 36, 49, 64, 81])\n",
    "y = np.array([1, 2, 3.1, 3.95, 5.01, 6, 6.97, 8, 9.02])\n",
    "print(\"x=2.5 f(x)=\", lagelangri(x, y, 2.5))  #x=2.5的时候  y=\n",
    "print(\"x=40 f(x)=\", lagelangri(x, y, 40))  #x=40的时候  y=\n",
    "xxx = []\n",
    "yyy = []\n",
    "for i in range(0, 900):\n",
    "    xxx.append(i / 10)\n",
    "    yyy.append(lagelangri(x, y, i / 10))\n",
    "\n",
    "pl.scatter(x, y)\n",
    "pl.plot(xxx, yyy)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 分段线性插值"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x=2.5 f(x)= 1.5\n",
      "x=40 f(x)= 6.298461538461538\n",
      "x=2.5 sqrt= 1.5811388300841898\n",
      "x=40 sqrt= 6.324555320336759\n"
     ]
    },
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAeVklEQVR4nO3deXxU1f3/8dfJvhASIGFJSAhr2BQCARVwAbXgWrTutS61tVaq1Vqs2n7ro6399fcttj/tpqKo7QMXoEaqRYtW0ZKqlECQPQIJkA0ISxIIWWfO748ECxgkhEzunTvv5z+SmSF+PM68c3LuuedjrLWIiIh7hTldgIiIfDkFtYiIyymoRURcTkEtIuJyCmoREZeLCMQ3TU5OtpmZmYH41iIinrRq1aq91tqUtp4LSFB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sbW20lrbBOQCk/DweLglqEO+ga4xxtCyBrnJWvvbo556A7i19c+3An/r6tq6mrX2YWttf2ttJi3vhfettTcTgmMBYK3dBZQYY7JaH7oQ2EiIjgctSx5nG2PiWj83F9JyTcez4+GaOxONMZfSsi55pIHuL52tqGsZY6YAy4F1/Hdd9hFa1qkXAhm0vEGvtdbud6RIBxhjLgB+aK293BjTixAdC2PMWFourEYBRcDttEy0QnU8fgZcT8tuqQLgW0A3PDoerglqERFpm1uWPkRE5AQU1CIiLqegFhFxOQW1iIjLKahFRFxOQS0i4nIKahERl/v/3z1IOXOSWn0AAAAASUVORK5CYII=\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pylab as pl\n",
    "import math\n",
    "\n",
    "\n",
    "def fenduan(x, y, ans_x):  #  ans_x :f(ans_x)\n",
    "    ans_y = 0\n",
    "    for i in range(len(x) - 1):\n",
    "        if x[i] <= ans_x <= x[i + 1]:\n",
    "            ans_y = y[i] * ((ans_x - x[i + 1]) / (x[i] - x[i + 1])) + y[i + 1] * ((ans_x - x[i]) / (x[i + 1] - x[i]))\n",
    "\n",
    "    return ans_y\n",
    "\n",
    "\n",
    "x = np.array([1, 4, 9, 16, 25, 36, 49, 64, 81])\n",
    "y = np.array([1, 2, 3.1, 3.95, 5.01, 6, 6.97, 8, 9.02])\n",
    "\n",
    "xxx = []\n",
    "yyy = []\n",
    "for i in range(0, 900):\n",
    "    xxx.append(i / 10)\n",
    "    yyy.append(fenduan(x, y, i / 10))\n",
    "\n",
    "pl.scatter(x, y)\n",
    "pl.plot(xxx, yyy)\n",
    "\n",
    "#精度验证\n",
    "print(\"x=2.5 f(x)=\", fenduan(x, y, 2.5))  #x=2.5的时候  y=\n",
    "print(\"x=40 f(x)=\", fenduan(x, y, 40))  #x=40的时候  y=\n",
    "print(\"x=2.5 sqrt=\", math.sqrt(2.5))\n",
    "print(\"x=40 sqrt=\", math.sqrt(40))"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 复合梯形公式"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "梯形公式 0.13090909090909092\n"
     ]
    }
   ],
   "source": [
    "#被积函数\n",
    "def fun(x):\n",
    "    return 1 / x\n",
    "\n",
    "\n",
    "#复合梯形\n",
    "def tx(a, b, n):\n",
    "    h = (b - a) / n\n",
    "    x = a\n",
    "    s = fun(x) - fun(b)\n",
    "    for k in range(1, n + 1):\n",
    "        x = x + h\n",
    "        s = s + 2 * fun(x)\n",
    "        result = (h / 2) * s\n",
    "        return result\n",
    "\n",
    "\n",
    "a = 1\n",
    "b = 5\n",
    "n1 = 40\n",
    "n2 = 20\n",
    "t = tx(a, b, n1)  #起始值、结束值、分成几段\n",
    "print(\"梯形公式\", t)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 复合辛普森求积公式"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "辛普森公式 1.6094411643415028\n"
     ]
    }
   ],
   "source": [
    "def fun(x):\n",
    "    return 1 / x\n",
    "\n",
    "\n",
    "#复合辛普森\n",
    "def xps(a, b, n):\n",
    "    h = (b - a) / n\n",
    "    x = a\n",
    "    s = fun(x) - fun(b)\n",
    "    for k in range(1, n + 1):\n",
    "        x = x + h / 2\n",
    "        s = s + 4 * fun(x)\n",
    "        x = x + h / 2\n",
    "        s = s + 2 * fun(x)\n",
    "    result = (h / 6) * s\n",
    "    return result\n",
    "\n",
    "\n",
    "a = 1\n",
    "b = 5\n",
    "n2 = 20\n",
    "p = xps(a, b, n2)  #起始值、结束值、分成几段\n",
    "print(\"辛普森公式\", p)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 高斯求积公式"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.60943789295249\n",
      "1.948161032494511e-08\n"
     ]
    }
   ],
   "source": [
    "from math import exp\n",
    "from math import sqrt\n",
    "from math import log\n",
    "\n",
    "f = lambda x: 1 / x\n",
    "\n",
    "\n",
    "def G_quad(f, a, b, N):\n",
    "    h = (b - a) / N;\n",
    "\n",
    "    t = [-sqrt(3 / 5), 0, sqrt(3 / 5)]\n",
    "    A = [5 / 9, 8 / 9, 5 / 9]\n",
    "    x_fromt = [0, 0, 0]\n",
    "    Sum_G = 0\n",
    "    for k in range(N):\n",
    "        for i in range(3):\n",
    "            x_fromt[i] = h / 2 * t[i] + a + (k + 1 / 2) * h\n",
    "        Sum_G = Sum_G + h / 2 * (A[0] * f(x_fromt[0]) + A[1] * f(x_fromt[1]) + A[2] * f(x_fromt[2]))\n",
    "    return Sum_G\n",
    "\n",
    "\n",
    "quadG = G_quad(f, 1, 5, 15)  #函数体、起始值、结束值、分成几段. 这里是1，5之间分成15段\n",
    "\n",
    "print(quadG)\n",
    "print(log(5) - quadG)  #截断误差\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 高斯列主元"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "高斯列主元：(1, array([0.        , 0.        , 0.        , 0.50819672]))\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "\n",
    "def Gauss(A, b):\n",
    "    n = len(b);\n",
    "    index = 1;\n",
    "    x = np.zeros(n)\n",
    "    for k in range(n):\n",
    "        #＇选主元＇\n",
    "        a_max = 0\n",
    "        for i in range(k, n):\n",
    "            if abs(A[i][k]) > a_max:\n",
    "                a_max = abs(A[i][k])\n",
    "                r = i\n",
    "            if a_max < 0.00000001:\n",
    "                index = 0\n",
    "                return\n",
    "                #＇交换两行＇\n",
    "            if r > k:\n",
    "                for j in range(k, n):\n",
    "                    z = A[k][j];\n",
    "                    A[k][j] = A[r][j];\n",
    "                    A[r][j] = z\n",
    "                z = b[k];\n",
    "                b[k] = b[r];\n",
    "                b[r] = z;\n",
    "                #＂消元计算＂\n",
    "            for i in range(k + 1, n):\n",
    "                m = A[i][k] / A[k][k]\n",
    "                for j in range(k + 1, n):\n",
    "                    A[i][j] = A[i][j] - m * A[k][j]\n",
    "                b[i] = b[i] - m * b[k]\n",
    "            #回代过程\n",
    "            if abs(A[n - 1][n - 1]) < 0.0000001:\n",
    "                index = 0\n",
    "                return\n",
    "            for k in range(n - 1, 0 - 1, -1):\n",
    "                for j in range(k + 1, n): b[k] = b[k] - A[k][j] * x[j]\n",
    "                x[k] = b[k] / A[k][k]\n",
    "                return index, x\n",
    "\n",
    "\n",
    "A = [[15, 2, 3, 2], [3, 15, 6, 5], [5, 6, 18, 3], [6, 5, 4, 13]]\n",
    "b = [22, 28, 13, 15]\n",
    "print(\"高斯列主元：{}\".format(Gauss(A, b)))"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 雅可比迭代"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2, 1, array([ 6. ,  7.5, -6. ]))\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "\n",
    "#A:左边的3*3的矩阵 b:右边3*1的矩阵 x0:x的初值\n",
    "# it_max:限制的最大迭代次数\n",
    "#ep:设置精度\n",
    "def Jacobi(A, b, x0, it_max, ep):\n",
    "    D = np.diag(np.diag(A))\n",
    "    U = -np.triu(A, 1)\n",
    "    L = -np.tril(A, -1)\n",
    "    B = np.dot(np.linalg.inv(D), (L + U))\n",
    "    f = np.dot(np.linalg.inv(D), b)\n",
    "    x = np.dot(B, x0) + f\n",
    "    k = 1\n",
    "    index = 1\n",
    "    while np.linalg.norm(x - x0) >= ep:\n",
    "        x = x0\n",
    "        x = np.dot(B, x0) + f\n",
    "        k = k + 1\n",
    "        if k > it_max:\n",
    "            index = 0\n",
    "            break\n",
    "        return k, index, x\n",
    "\n",
    "\n",
    "A = [[4, 3, 0], [3, 4, -1], [0, -1, 4]]\n",
    "b = [24, 30, -24]\n",
    "x0 = [0, 0, 0]\n",
    "print(Jacobi(A, b, x0, 100, 0.000001))"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 高斯赛德尔迭代"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2, 1, array([ 6.  ,  3.  , -5.25]))\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "\n",
    "#A:左边的3*3的矩阵 b:右边3*1的矩阵 x0:x的初值\n",
    "# it_max:限制的最大迭代次数\n",
    "#ep:设置精度\n",
    "def G_S(A, b, x0, it_max, ep):\n",
    "    D = np.diag(np.diag(A))\n",
    "    U = -np.triu(A, 1)\n",
    "    L = -np.tril(A, -1)\n",
    "    B = np.dot(np.linalg.inv(D - L), U)\n",
    "    f = np.dot(np.linalg.inv(D - L), b)\n",
    "    x = np.dot(B, x0) + f\n",
    "    k = 1\n",
    "    index = 1\n",
    "    while np.linalg.norm(x - x0) >= ep:\n",
    "        x = x0\n",
    "        x = np.dot(B, x0) + f\n",
    "        k = k + 1\n",
    "        if k > it_max:\n",
    "            index = 0\n",
    "            break\n",
    "        return k, index, x\n",
    "\n",
    "\n",
    "A = [[4, 3, 0], [3, 4, -1], [0, -1, 4]]\n",
    "b = [24, 30, -24]\n",
    "x0 = [0, 0, 0]\n",
    "print(G_S(A, b, x0, 100, 0.000001))"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 二分法"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1, 20, 0.25753116607666016)\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#原函数\n",
    "f = lambda x: x ** 2 - 3 * x + 2 - math.e ** x\n",
    "\n",
    "\n",
    "#迭代法\n",
    "#f:原函数 起始值 结束值 设置精度\n",
    "def b(f, a, b, ep):\n",
    "    fa = f(a)\n",
    "    fb = f(b)\n",
    "\n",
    "    if fa * fb > 0:\n",
    "        return 0\n",
    "    k = 1\n",
    "    while abs(b - a) / 2 > ep:\n",
    "        x = (a + b) / 2\n",
    "        fx = f(x)\n",
    "        if fx == 0:\n",
    "            return 1, k, x\n",
    "        elif fx * fa < 0:\n",
    "            fb = fx\n",
    "            b = x\n",
    "        else:\n",
    "            fa = fx\n",
    "            a = x\n",
    "        k += 1\n",
    "\n",
    "    x = (a + b) / 2\n",
    "    return 1, k, x\n",
    "\n",
    "\n",
    "ans_b = b(f, 0, 1, 10 ** -6)\n",
    "print(ans_b)\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 牛顿法"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1, 4, 0.257530285439827)\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#原函数\n",
    "f = lambda x: x ** 2 - 3 * x + 2 - math.e ** x\n",
    "#原函数的导数\n",
    "fd = lambda x: 2 * x - 3 - math.e ** x\n",
    "\n",
    "\n",
    "#f:原函数 导数 起始值 结束值 设置精度\n",
    "def n(f, fd, x, ep, it_max):\n",
    "    index = 0\n",
    "    k = 1\n",
    "    while k < it_max:\n",
    "        x1 = x\n",
    "        fv = f(x)\n",
    "        fdv = fd(x)\n",
    "        if abs(fdv) < ep:\n",
    "            break\n",
    "        x = x1 - fv / fdv\n",
    "        if abs(x - x1) < ep:\n",
    "            index = 1\n",
    "            break\n",
    "        k += 1\n",
    "    return index, k, x\n",
    "\n",
    "\n",
    "ans_n = n(f, fd, 1.5, 10 ** -6, 20)\n",
    "print((ans_n))\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 欧拉法"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "outputs": [
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mKeyboardInterrupt\u001B[0m                         Traceback (most recent call last)",
      "Input \u001B[1;32mIn [46]\u001B[0m, in \u001B[0;36m<cell line: 6>\u001B[1;34m()\u001B[0m\n\u001B[0;32m      3\u001B[0m \u001B[38;5;28;01mimport\u001B[39;00m \u001B[38;5;21;01mpylab\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m \u001B[38;5;21;01mpl\u001B[39;00m\n\u001B[0;32m      5\u001B[0m h \u001B[38;5;241m=\u001B[39m \u001B[38;5;241m0.01\u001B[39m\n\u001B[1;32m----> 6\u001B[0m n \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mint\u001B[39;49m(\u001B[38;5;241m1\u001B[39m \u001B[38;5;241m/\u001B[39m h)\n\u001B[0;32m      7\u001B[0m f \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mlambda\u001B[39;00m x, y: \u001B[38;5;241m-\u001B[39m\u001B[38;5;241m50\u001B[39m \u001B[38;5;241m*\u001B[39m y \u001B[38;5;241m+\u001B[39m \u001B[38;5;241m50\u001B[39m \u001B[38;5;241m*\u001B[39m x \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39m \u001B[38;5;241m2\u001B[39m \u001B[38;5;241m+\u001B[39m \u001B[38;5;241m2\u001B[39m \u001B[38;5;241m*\u001B[39m x\n\u001B[0;32m      9\u001B[0m \u001B[38;5;66;03m#f:函数体\u001B[39;00m\n\u001B[0;32m     10\u001B[0m \u001B[38;5;66;03m# x0初值\u001B[39;00m\n\u001B[0;32m     11\u001B[0m \u001B[38;5;66;03m# y0初值\u001B[39;00m\n\u001B[0;32m     12\u001B[0m \u001B[38;5;66;03m# h 间距\u001B[39;00m\n",
      "Input \u001B[1;32mIn [46]\u001B[0m, in \u001B[0;36m<cell line: 6>\u001B[1;34m()\u001B[0m\n\u001B[0;32m      3\u001B[0m \u001B[38;5;28;01mimport\u001B[39;00m \u001B[38;5;21;01mpylab\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m \u001B[38;5;21;01mpl\u001B[39;00m\n\u001B[0;32m      5\u001B[0m h \u001B[38;5;241m=\u001B[39m \u001B[38;5;241m0.01\u001B[39m\n\u001B[1;32m----> 6\u001B[0m n \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mint\u001B[39;49m(\u001B[38;5;241m1\u001B[39m \u001B[38;5;241m/\u001B[39m h)\n\u001B[0;32m      7\u001B[0m f \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mlambda\u001B[39;00m x, y: \u001B[38;5;241m-\u001B[39m\u001B[38;5;241m50\u001B[39m \u001B[38;5;241m*\u001B[39m y \u001B[38;5;241m+\u001B[39m \u001B[38;5;241m50\u001B[39m \u001B[38;5;241m*\u001B[39m x \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39m \u001B[38;5;241m2\u001B[39m \u001B[38;5;241m+\u001B[39m \u001B[38;5;241m2\u001B[39m \u001B[38;5;241m*\u001B[39m x\n\u001B[0;32m      9\u001B[0m \u001B[38;5;66;03m#f:函数体\u001B[39;00m\n\u001B[0;32m     10\u001B[0m \u001B[38;5;66;03m# x0初值\u001B[39;00m\n\u001B[0;32m     11\u001B[0m \u001B[38;5;66;03m# y0初值\u001B[39;00m\n\u001B[0;32m     12\u001B[0m \u001B[38;5;66;03m# h 间距\u001B[39;00m\n",
      "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_310_64.pyx:1180\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_310_64.SafeCallWrapper.__call__\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_310_64.pyx:621\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_310_64.PyDBFrame.trace_dispatch\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_310_64.pyx:930\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_310_64.PyDBFrame.trace_dispatch\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_310_64.pyx:921\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_310_64.PyDBFrame.trace_dispatch\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_310_64.pyx:318\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_310_64.PyDBFrame.do_wait_suspend\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mD:\\app\\apps\\PyCharm-P\\ch-0\\213.7172.26\\plugins\\python\\helpers\\pydev\\pydevd.py:1147\u001B[0m, in \u001B[0;36mPyDB.do_wait_suspend\u001B[1;34m(self, thread, frame, event, arg, send_suspend_message, is_unhandled_exception)\u001B[0m\n\u001B[0;32m   1144\u001B[0m         from_this_thread\u001B[38;5;241m.\u001B[39mappend(frame_id)\n\u001B[0;32m   1146\u001B[0m \u001B[38;5;28;01mwith\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_threads_suspended_single_notification\u001B[38;5;241m.\u001B[39mnotify_thread_suspended(thread_id, stop_reason):\n\u001B[1;32m-> 1147\u001B[0m     \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_do_wait_suspend\u001B[49m\u001B[43m(\u001B[49m\u001B[43mthread\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mframe\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mevent\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43marg\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43msuspend_type\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mfrom_this_thread\u001B[49m\u001B[43m)\u001B[49m\n",
      "File \u001B[1;32mD:\\app\\apps\\PyCharm-P\\ch-0\\213.7172.26\\plugins\\python\\helpers\\pydev\\pydevd.py:1162\u001B[0m, in \u001B[0;36mPyDB._do_wait_suspend\u001B[1;34m(self, thread, frame, event, arg, suspend_type, from_this_thread)\u001B[0m\n\u001B[0;32m   1159\u001B[0m             \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_call_mpl_hook()\n\u001B[0;32m   1161\u001B[0m         \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mprocess_internal_commands()\n\u001B[1;32m-> 1162\u001B[0m         \u001B[43mtime\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43msleep\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m0.01\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[0;32m   1164\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcancel_async_evaluation(get_current_thread_id(thread), \u001B[38;5;28mstr\u001B[39m(\u001B[38;5;28mid\u001B[39m(frame)))\n\u001B[0;32m   1166\u001B[0m \u001B[38;5;66;03m# process any stepping instructions\u001B[39;00m\n",
      "\u001B[1;31mKeyboardInterrupt\u001B[0m: "
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import math\n",
    "import pylab as pl\n",
    "\n",
    "h = 0.01\n",
    "n = int(1 / h)\n",
    "f = lambda x, y: -50 * y + 50 * x ** 2 + 2 * x\n",
    "\n",
    "# f: 函数体\n",
    "# x0 初值\n",
    "# y0 初值\n",
    "# h 间距\n",
    "# n 不用你管\n",
    "def E(f, x0, y0, h, N):\n",
    "    x = np.zeros(N + 1)\n",
    "    y = np.zeros(N + 1)\n",
    "    x[0] = x0\n",
    "    y[0] = y0\n",
    "    for i in range(N):\n",
    "        x[i + 1] = x[i] + h\n",
    "        y[i + 1] = y[i] + h * f(x[i], y[i])\n",
    "    return x, y\n",
    "\n",
    "\n",
    "[xx, yy] = E(f, 0, 1 / 3, h, n)\n",
    "print(xx)\n",
    "print(yy)\n",
    "\n",
    "xxx = np.arange(0, 1 + h, h)\n",
    "yyy = []\n",
    "for i in xxx:\n",
    "    yyy.append((math.e ** (-50 * i) / 3) + i ** 2)\n",
    "    # yyy.append(xxx)\n",
    "pl.plot(xx, yy, label=\"Euler\", linestyle=\":\")\n",
    "\n",
    "pl.plot(xxx, yyy, color=\"red\", label=\"right\", alpha=0.3)\n",
    "pl.legend()\n",
    "pl.show()\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 改进欧拉法"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.   0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1  0.11 0.12 0.13\n",
      " 0.14 0.15 0.16 0.17 0.18 0.19 0.2  0.21 0.22 0.23 0.24 0.25 0.26 0.27\n",
      " 0.28 0.29 0.3  0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4  0.41\n",
      " 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5  0.51 0.52 0.53 0.54 0.55\n",
      " 0.56 0.57 0.58 0.59 0.6  0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69\n",
      " 0.7  0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8  0.81 0.82 0.83\n",
      " 0.84 0.85 0.86 0.87 0.88 0.89 0.9  0.91 0.92 0.93 0.94 0.95 0.96 0.97\n",
      " 0.98 0.99 1.  ] [0.33333333 0.20845833 0.13064896 0.0823306  0.05251912 0.03434945\n",
      " 0.02353091 0.01738182 0.01422614 0.01301633 0.01309771 0.01406107\n",
      " 0.01565067 0.01770667 0.02012917 0.02285573 0.02584733 0.02907958\n",
      " 0.03253724 0.03621077 0.04009423 0.0441839  0.04847744 0.0529734\n",
      " 0.05767087 0.0625693  0.06766831 0.07296769 0.07846731 0.08416707\n",
      " 0.09006692 0.09616682 0.10246676 0.10896673 0.1156667  0.12256669\n",
      " 0.12966668 0.13696668 0.14446667 0.15216667 0.16006667 0.16816667\n",
      " 0.17646667 0.18496667 0.19366667 0.20256667 0.21166667 0.22096667\n",
      " 0.23046667 0.24016667 0.25006667 0.26016667 0.27046667 0.28096667\n",
      " 0.29166667 0.30256667 0.31366667 0.32496667 0.33646667 0.34816667\n",
      " 0.36006667 0.37216667 0.38446667 0.39696667 0.40966667 0.42256667\n",
      " 0.43566667 0.44896667 0.46246667 0.47616667 0.49006667 0.50416667\n",
      " 0.51846667 0.53296667 0.54766667 0.56256667 0.57766667 0.59296667\n",
      " 0.60846667 0.62416667 0.64006667 0.65616667 0.67246667 0.68896667\n",
      " 0.70566667 0.72256667 0.73966667 0.75696667 0.77446667 0.79216667\n",
      " 0.81006667 0.82816667 0.84646667 0.86496667 0.88366667 0.90256667\n",
      " 0.92166667 0.94096667 0.96046667 0.98016667 1.00006667]\n"
     ]
    },
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAoiklEQVR4nO3dd1yVdf/H8deHISAgoOBEBLeW41bUhnlrZo4y07sypXGXaaVmO2daao5M08pxmzmampp7jzS34h7kxIGaIO4t8P39AfUjQznqgeuMz/Px8BHnXNc51/sb+Obye64hxhiUUko5Pw+rAyillLIPLXSllHIRWuhKKeUitNCVUspFaKErpZSL8LJqw6GhoSYyMtKqzSullFPauHHjSWNMWFbLLCv0yMhIYmNjrdq8Uko5JRE5dLNlOuWilFIuQgtdKaVchBa6Ukq5CMvm0LNy/fp1EhISuHLlitVRcpyvry/h4eF4e3tbHUUp5SIcqtATEhIIDAwkMjISEbE6To4xxpCcnExCQgJRUVFWx1FKuYhsp1xEZKyIJIrIjpssFxH5QkT2icg2Eal2p2GuXLlCgQIFXLrMAUSEAgUKuMW/RJRSuceWOfTxQKNbLG8MlMn40w4YeTeBXL3M/+Qu41RK5Z5sC90Y8xtw6harNAO+NenWAsEiUsReAZVSypV8+X0ntu1dmSPvbY859GLAkUyPEzKeO37jiiLSjvS9eCIiIuywaaWUch5TFg5j4dwvSb12lcplatv9/e1x2GJWcwdZ3jXDGDPaGBNtjIkOC8vyzFXLeXp6UrVq1b/+DBgwwOpISikXsOvAOn78oTMloqrS8YUvc2Qb9thDTwCKZ3ocD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tdKWUchFa6Eop5SK00JVSykVooSullIvQQldKKRehha6UUi7i/wA0QNcgvZKHNwAAAABJRU5ErkJggg==\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import math\n",
    "import pylab as pl\n",
    "\n",
    "h = 0.01\n",
    "n = int(1 / h)\n",
    "f = lambda x, y: -50 * y + 50 * x ** 2 + 2 * x\n",
    "\n",
    "#f:函数体\n",
    "# x0初值\n",
    "# y0初值\n",
    "# h 间距\n",
    "# n不用你管\n",
    "def E_r(f, x0, y0, h, N):\n",
    "    x = np.zeros(N + 1)\n",
    "    y = np.zeros(N + 1)\n",
    "    x[0] = x0\n",
    "    y[0] = y0\n",
    "    for i in range(N):\n",
    "        x[i + 1] = x[i] + h\n",
    "        y_b = y[i] + h * f(x[i], y[i])\n",
    "        y[i + 1] = y[i] + h / 2 * (f(x[i], y[i]) + f(x[i + 1], y_b))\n",
    "    return x, y\n",
    "\n",
    "\n",
    "[xx_r, yy_r] = E_r(f, 0, 1 / 3, h, n)\n",
    "print(xx_r, yy_r)\n",
    "\n",
    "xxx = np.arange(0, 1 + h, h)\n",
    "yyy = []\n",
    "for i in xxx:\n",
    "    yyy.append((math.e ** (-50 * i) / 3) + i ** 2)\n",
    "    # yyy.append(xxx)\n",
    "\n",
    "pl.plot(xx_r, yy_r, label=\"E_r\", color=\"green\", linestyle=\"-\")\n",
    "\n",
    "pl.plot(xxx, yyy, color=\"red\", label=\"right\", alpha=0.3)\n",
    "pl.legend()\n",
    "pl.show()\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 龙格库塔法"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.   0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1  0.11 0.12 0.13\n",
      " 0.14 0.15 0.16 0.17 0.18 0.19 0.2  0.21 0.22 0.23 0.24 0.25 0.26 0.27\n",
      " 0.28 0.29 0.3  0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4  0.41\n",
      " 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5  0.51 0.52 0.53 0.54 0.55\n",
      " 0.56 0.57 0.58 0.59 0.6  0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69\n",
      " 0.7  0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8  0.81 0.82 0.83\n",
      " 0.84 0.85 0.86 0.87 0.88 0.89 0.9  0.91 0.92 0.93 0.94 0.95 0.96 0.97\n",
      " 0.98 0.99 1.  ] [0.33333333 0.2023572  0.12312403 0.07536562 0.04678383 0.02991649\n",
      " 0.02023579 0.01499437 0.01252523 0.01181687 0.01225555 0.01346886\n",
      " 0.01523085 0.01740439 0.01990631 0.02268612 0.02571319 0.02896894\n",
      " 0.03244209 0.0361258  0.04001592 0.04410992 0.04840628 0.05290407\n",
      " 0.05760273 0.06250192 0.06760142 0.07290112 0.07840094 0.08410083\n",
      " 0.09000077 0.09610072 0.1024007  0.10890069 0.11560068 0.12250067\n",
      " 0.12960067 0.13690067 0.14440066 0.15210066 0.16000066 0.16810066\n",
      " 0.17640066 0.18490066 0.19360066 0.20250066 0.21160066 0.22090066\n",
      " 0.23040066 0.24010066 0.25000066 0.26010066 0.27040066 0.28090066\n",
      " 0.29160066 0.30250066 0.31360066 0.32490066 0.33640066 0.34810066\n",
      " 0.36000066 0.37210066 0.38440066 0.39690066 0.40960066 0.42250066\n",
      " 0.43560066 0.44890066 0.46240066 0.47610066 0.49000066 0.50410066\n",
      " 0.51840066 0.53290066 0.54760066 0.56250066 0.57760066 0.59290066\n",
      " 0.60840066 0.62410066 0.64000066 0.65610066 0.67240066 0.68890066\n",
      " 0.70560066 0.72250066 0.73960066 0.75690066 0.77440066 0.79210066\n",
      " 0.81000066 0.82810066 0.84640066 0.86490066 0.88360066 0.90250066\n",
      " 0.92160066 0.94090066 0.96040066 0.98010066 1.00000066]\n"
     ]
    },
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAoO0lEQVR4nO3deXhU5d3/8fc3kz1kISRAQggECDsESNh3hMoqiCs+dQNKcelirRVra21t+2hFa1UoP7SotSpocQFJFVH2PWEPiAQSIGxJCBCSELLdvz+S+sQYyEAmc2Ym39d1ccnknMz53Mj14eSec+4jxhiUUkq5Py+rAyillHIMLXSllPIQWuhKKeUhtNCVUspDaKErpZSH8LbqwBEREaZt27ZWHV4ppdxSampqrjEmsrZtlhV627ZtSUlJserwSinllkTk6JW26ZSLUkp5CC10pZTyEFroSinlISybQ69NaWkpWVlZFBcXWx2lwfn7+xMTE4OPj4/VUZRSHsKlCj0rK4vg4GDatm2LiFgdp8EYYzh79ixZWVnExcVZHUcp5SHqnHIRkUUiki0i+66wXUTkZRFJF5E9ItLnesMUFxfTrFkzjy5zABGhWbNmjeInEaWU89gzh/4mMPYq28cB8VW/ZgF/r08gTy/z/2os41RKOU+dhW6MWQfkXWWXycA/TaUtQJiIRDkqoFJKeZKSnfsgP79B3tsRV7m0Ao5Xe51V9bXvEZFZIpIiIik5OTkOOLRSSrmP/X9bSfLov3J+y/4GeX9HFHptcwe1PjXDGLPQGJNkjEmKjKz1zlXL2Ww2evXqRffu3Zk0aRLnz5+/4r5r1qxh4sSJzgunlHJbOVuPsPfxd/Bp3ZKQkX0b5BiOKPQsoHW11zHASQe8ryUCAgLYtWsX+/btIzw8nHnz5lkdSSnl5i6fK2TDbS/hFeDLs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6Ukp5CJcudBEZKyIHRSRdRObUsl1E5OWq7XtEpI8VOR3JjjH/T9VY94jIJhFJsCKnI9U15mr79RWRchG51Zn5GoI9YxaRESKyS0TSRGStszM6mh1/t0NFZLmI7K4as1uvCSUii0QkW0T2XWG74/vLGOOSv6hcCOww0A7wBXYDXWvsMx74D5XrsQ8Atlqd2wljHgQ0rfr9uMYw5mr7fUXlmkK3Wp3bCf+fw6h8Klhs1evmVud2wph/DTxX9ftIIA/wtTp7PcY8DOgD7LvCdof3lyufoX/76DtjTAnw30ffVffto++MMVuAMBGJcnZQB6pzzMaYTcaYc1Uvt1C59rw7s+f/M8BPgKVAtjPDNRB7xnwX8KEx5hiAMcbdx23PmA0QXPXQ+SZUFnqZc2M6jjFmHZVjuBKH95crF7rDHn3nRq51PDOo/BfendU5ZhFpBdwMLMAz2PP/uSPQVETWiEiqiNzjtHQNw54xvwp0ofLhOHuBnxljKpwTzxIO7y+7ls+1iMMefedG7B6PiIykstCHNGiihmfPmF8CHjfGlFeevLk9e8bsDSQCNwABwGYR2WKM+aahwzUQe8Z8I7ALGAW0B74QkfXGmPwGzmYVh/eXKxd6Y3z0nV3jEZGewOvAOGPMWSdlayj2jDkJWFxV5hHAeBEpM8Z87JSEjmfv3+1cY0whUCgi64AEwF0L3Z4x3w88ayonmNNFJAPoDGxzTkSnc3h/ufKUS2N89F2dYxaRWOBD4G43Plurrs4xG2PijDFtjTFtgX8DD7pxmYN9f7c/AYaKiLeIBAL9gQNOzulI9oz5GJU/kSAiLYBOwBGnpnQuh/eXy56hm0b46Ds7x/wU0AyYX3XGWmbceKU6O8fsUewZszHmgIh8BuwBKoDXjTG1Xv7mDuz8//wM8KaI7KVyOuJxY4zbLqsrIu8BI4AIEckCfgf4QMP1l976r5RSHsKVp1yUUkpdAy10pZTyEFroSinlIbTQlVLKQ2ihK6WUh9BCV0opD6GFrpRSHuL/A2DXhj2610UZAAAAAElFTkSuQmCC\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import math\n",
    "import pylab as pl\n",
    "\n",
    "h = 0.01\n",
    "n = int(1 / h)\n",
    "f = lambda x, y: -50 * y + 50 * x ** 2 + 2 * x\n",
    "\n",
    "# f: 函数体\n",
    "# x0 初值\n",
    "# y0 初值\n",
    "# h 间距\n",
    "# n 不用你管\n",
    "def R_k(f, x0, y0, h, N):\n",
    "    x = np.zeros(N + 1)\n",
    "    y = np.zeros(N + 1)\n",
    "    x[0] = x0\n",
    "    y[0] = y0\n",
    "    for i in range(N):\n",
    "        x[i + 1] = x[i] + h\n",
    "        k1 = f(x[i], y[i])\n",
    "        k2 = f(x[i] + h / 2, y[i] + h / 2 * k1)\n",
    "        k3 = f(x[i] + h / 2, y[i] + h / 2 * k2)\n",
    "        k4 = f(x[i] + h, y[i] + h * k3)\n",
    "        y[i + 1] = y[i] + h / 6 * (k1 + k2 * 2 + k3 * 2 + k4)\n",
    "    return x, y\n",
    "\n",
    "\n",
    "[xx_R_k, yy_R_k] = R_k(f, 0, 1 / 3, h, n)\n",
    "print(xx_R_k, yy_R_k)\n",
    "\n",
    "xxx = np.arange(0, 1 + h, h)\n",
    "yyy = []\n",
    "for i in xxx:\n",
    "    yyy.append((math.e ** (-50 * i) / 3) + i ** 2)\n",
    "    # yyy.append(xxx)\n",
    "\n",
    "pl.plot(xx_R_k, yy_R_k, label=\"R_k\", linestyle=\"--\", color=\"purple\")\n",
    "pl.plot(xxx, yyy, color=\"red\", label=\"right\", alpha=0.3)\n",
    "pl.legend()\n",
    "pl.show()\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlc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AiFjib95c9T7kUxnuZ5jpmpVQw8CvQ1YH31rLKdcxa6/Ja6xCtdQjwC/CKA5c5WPd3ex7QUCnlopTyAu4H4go4py1ZM+bDZP5GglKqJFAV2F+gKQuWzfvLbvfQdSG8l6mVYx4C+ANfXttjTdcOfKU6K8fsVKwZs9Y6Tin1B7ADyACmaq1zPPzNEVj5fR4BTFdK7SRzOuJdrbXDXlZXKfUj0BgIUEolAEMBV8i//pJT/4UQwknY85SLEEKIOyCFLoQQTkIKXQghnIQUuhBCOAkpdCGEcBJS6EII4SSk0IUQwkn8H0CN1PcY5ZT+AAAAAElFTkSuQmCC\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "xxx = np.arange(0, 1 + h, h)\n",
    "yyy = []\n",
    "for i in xxx:\n",
    "    yyy.append((math.e ** (-50 * i) / 3) + i ** 2)\n",
    "    # yyy.append(xxx)\n",
    "pl.plot(xx, yy, label=\"Euler\", linestyle=\":\")\n",
    "pl.plot(xx_r, yy_r, label=\"E_r\", color=\"green\", linestyle=\"-\")\n",
    "pl.plot(xx_R_k, yy_R_k, label=\"R_k\", linestyle=\"--\", color=\"purple\")\n",
    "pl.plot(xxx, yyy, color=\"red\", label=\"right\", alpha=0.3)\n",
    "pl.legend()\n",
    "pl.show()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 一阶常微分"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}